﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using SystemModels;
using SystemDALInterface;
using SystemDALFactory;

namespace SystemBLL
{
    /// <summary>
    /// 用户信息逻辑处理层
    /// </summary>
    public class UserBLL
    {
        /// <summary>
        ///创建用户管理接口实例
        /// </summary>
        IUserManager _userManager = Factory.CreateUserManager();

        #region 用户校验
        /// <summary>
        /// 用户校验
        /// </summary>
        /// <param name="userId">用户编号</param>
        /// <param name="pwd">用户密码</param>
        /// <returns>Users</returns>
        public Users CheckUser(int userId, string pwd)
        {
            //返回用户登录的结果
            return _userManager.CheckUser(userId, pwd);
        }
        #endregion

        #region 修改用户
        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="user">当前用户</param>
        public bool ChangeUser(Users user)
        {
            return _userManager.ChangeUser(user);
        }
        #endregion
        
    }
}
